package com.sicilin.dao;

import com.sicilin.po.TSysAuth;
import com.sicilin.system.auth.dto.TreeAuth;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;

public interface AuthDao {
    int saveAuth(TSysAuth auth);

    int deleteAuth(@Param("authId") int authId);

    int deleteRoleAuth(@Param("authId") int authId);

    int existAuthTotalCode(@Param("authTotalCode") String authTotalCode);

    TSysAuth getParentAuthBySonId(@Param("authId") int authId);

    int countBrotherAuthById(@Param("authId") int authId);

    TSysAuth getAuthById(@Param("authId") int authId);

    List<TreeAuth> getTreeAuth();

    List<TreeAuth> getTreeAuthWidthCheckedByRoleId(@Param("roleId")Integer roleId);

    int updateAuthHasChildren(@Param("authId") int authId,@Param("hasChildren") int hasChildren);

    List<TSysAuth> filterHigherLevel(@Param("authIds") Collection<Integer> authIds, @Param("level") int level);

    int updateAuth(@Param("authId") int authId ,@Param("authName") String authName,@Param("authType") int authType, @Param("level") int level);
}
